/**
* Created by ren on 2017/1/3.
*/
<template>
  <div class='more page-wrap'>
    <Nav :cut="'more'"></Nav>
    <div class="container">
      <div class="moremain page">
        <ul>
          <li style="text-align: center"><img src="./assets/logo4.png"></li>
          <li :class="{active:cutName==='buyrecord'}" @click="cut('buyrecord')"><img
            :src="cutName==='buyrecord'?require('./assets/buyrecord_none_1.png'):require('./assets/buyrecord_none.png')"><span>购买记录</span>
          </li>
          <li :class="{active:cutName==='redpack'}" @click="cut('redpack')"><img
            :src="cutName==='redpack'?require('./assets/redpack-1.png'):require('./assets/redpack.png')"><span>我的红包</span>
          </li>
          <li :class="{active:cutName==='voucher'}" @click="cut('voucher')"><img
            :src="cutName==='voucher'?require('./assets/voucher-1.png'):require('./assets/voucher.png')"><span>优惠券</span>
          </li>
          <li :class="{active:cutName==='safe'}" @click="cut('safe')"><img
            :src="cutName==='safe'?require('./assets/safe-1.png'):require('./assets/safe.png')"><span>信息安全</span>
          </li>
          <li :class="{active:cutName==='opinions'}" @click="cut('opinions')"><img
            :src="cutName==='opinions'?require('./assets/advice-1.png'):require('./assets/advice.png')"><span>意见反馈</span>
          </li>
        </ul>
        <div class="main-wrap">
          <div class="tit" v-html="titHtml"></div>
          <div class="main-con">
            <router-view :_parentThis="this"></router-view>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import Nav from './components/Nav'
  import ECharts from 'vue-echarts/dist/vue-echarts'
  export default {
    name: 'personMain',
    components: {
      Nav,
      'chart': ECharts
    },
    data: function () {
      return {
        cutName: 'buyrecord',
        jinshengjinData: [],
        notifyStatus: 2,
        titHtml: '<span>购买记录</span>',
        redPackChild: 'parent',
        voucherChild: 'parent',
        safeChild: 'parent',
        buyChild: 'parent'
      }
    },
    methods: {
      cut: function (name) {
        this.cutName = name
        switch (name) {
          case 'buyrecord':
            this.titHtml = '<span>购买记录</span>'
            this.buyChild = 'parent'
            this.$router.push({name: 'moreGoods'})
            break
          case 'redpack':
            this.titHtml = '<span>我的红包</span>'
            this.redPackChild = 'parent'
            this.$router.push({name: 'redpackList'})
            break
          case 'voucher':
            this.titHtml = '<span>我的优惠券</span>'
            this.voucherChild = 'parent'
            this.$router.push({name: 'voucher'})
            break
          case 'safe':
            this.titHtml = '<span>信息安全</span><span style="color: #009832;margin-left: 20px">建议您妥善保管您的支付账号密码，切勿向他人泄露！</span>'
            this.safeChild = 'parent'
            this.$router.push({name: 'safeMain'})
            break
          case 'opinions':
            this.titHtml = '<span>意见反馈</span>'
            this.safeChild = 'parent'
            this.$router.push({name: 'opinions'})
            break
        }
      }
    },
    mounted: function () {
      if (!this.$cookie.get('id')) {
        this.$router.push({'name': 'login'})
        return
      }
    }
  }
</script>
<style>
  @import "./scss/home.scss";
</style>

